<a href='https://github.com/angular/angular.js/edit/v1.5.x/docs/content/error/$compile/baddir.ngdoc?message=docs(error%2Fbaddir)%3A%20describe%20your%20change...' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>


<h1>Error: $compile:baddir
  <div><span class='hint'>Invalid Directive Name</span></div>
</h1>

<div>
    <pre class="minerr-errmsg" error-display="Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces">Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces</pre>
</div>

<h2>Description</h2>
<div class="description">
  <p>This error occurs when the name of a directive is not valid.</p>
<p>Directives must start with a lowercase character and must not contain leading or trailing whitespaces.</p>

</div>


